package com.jinzhi.jzweb.dao;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.BaseDao;
import com.jinzhi.jzweb.domain.TrainingCertificatesDO;
import com.jinzhi.jzweb.domain.vo.Data2Vo;
import com.jinzhi.jzweb.domain.vo.TeachersVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 *
 * <pre>
 * 培训证书
 * </pre>
 * <small> 2020-06-02 09:10:46 | lance</small>
 */
public interface TrainingCertificatesDao extends BaseDao<TrainingCertificatesDO> {


	@Select("select id , user_id as userId , courses_id as coursesId , numbers , get_time as getTime ," +
			"img_url as imgUrl , queries , state from jz_training_certificates where state = 0 and " +
			"user_id = #{userId} order by get_time desc")
	List<TrainingCertificatesDO> findPageList(Page<TrainingCertificatesDO> page, @Param("userId")Long userId);

	String selCerNumber(@Param("cerNums") String cerNums);

	List<TrainingCertificatesDO> selData2Vo(Page<TrainingCertificatesDO> page , @Param("name")String name);

	List<TeachersVo> selTeachersList(Page<TeachersVo> page , @Param("teachersVo")TeachersVo teachersVo);

	Integer selTrainingCertificatesByName(@Param("name") String name);


	List<Map<Object, Object>>  selTrainingStuCount();
	String selByCerNumber(@Param("cerNums") String cerNums);

	List<Map> selImgUrls(Map map);


	List<String> selSjxmImgUrls(Map map);

	List<Map> selNoSaleImgUrls(Map map);

	//查询全部列表
	List<Map>  rainingListX();

	//修改成阿里云OSS路径
	int updatetrainingX(@Param("img_url") String img_url, @Param("id") String id, @Param("img_url_nosale") String img_url_nosale);

	List<Map> allMobile();
}
